setwd("~/Box Sync/Replication_AJPS_0215/Figure_1")
ayp<-read.csv("AYP.csv")
ayp$NAEP<-ayp$NAEP*100
ayp$Proficient<-ayp$Proficient*100
ayp$Required<-ayp$Required*100
ayp$Failure<-ayp$Failure*100
library(reshape2)
longayp<-melt(ayp, id.vars="FY")

library(ggplot2)

pdf("naep.pdf", width=7, height=4)
ggplot(ayp, aes(FY, colour=Key)) + 
	ylim(0, 100)+ ylab("Percent")+xlab("Year")+
	 geom_line(aes(y = NAEP, colour = "NAEP Proficiency"))+
	geom_point(aes(y=NAEP,colour="NAEP Proficiency"))+
	 scale_color_manual(values=c("NAEP Proficiency"="red"))
dev.off()


pdf("ohio.pdf", width=7, height=4)
ggplot(ayp, aes(FY, colour=Key)) + 
	ylim(0, 100)+ ylab("Percent")+xlab("Year")+
	 geom_line(aes(y = NAEP, colour = "NAEP Proficiency"))+
	geom_point(aes(y=NAEP,colour="NAEP Proficiency"))+
geom_line(aes(y = Proficient, colour = "Ohio Proficiency"))+
	geom_point(aes(y=Proficient,colour="Ohio Proficiency"))+
	 scale_color_manual(values=c("Ohio Proficiency"="blue", "NAEP Proficiency"="red"),breaks=c("NAEP Proficiency","Ohio Proficiency"))
dev.off()

pdf("ayp.pdf", width=7, height=4)
ggplot(ayp, aes(FY, colour=Key)) + 
	ylim(0, 100)+ ylab("Percent")+xlab("Year")+
	 geom_line(aes(y = NAEP, colour = "NAEP Proficiency"))+
	geom_point(aes(y=NAEP,colour="NAEP Proficiency"))+
geom_line(aes(y = Proficient, colour = "Ohio Proficiency"))+
	geom_point(aes(y=Proficient,colour="Ohio Proficiency"))+
geom_line(aes(y = Required, colour = "AYP Requirement"))+
	geom_point(aes(y=Required,colour="AYP Requirement"))+
	 scale_color_manual(values=c("AYP Requirement"="darkgreen","Ohio Proficiency"="blue", "NAEP Proficiency"="red"),breaks=c("NAEP Proficiency","Ohio Proficiency","AYP Requirement"))
dev.off()

pdf("Figure_1.pdf", width=6, height=5)
ggplot(ayp, aes(FY, colour=Key)) + 
	ylim(0, 100)+ ylab("Percent")+xlab("Year")+
	 geom_line(aes(y = NAEP, colour = "Proficient Students (NAEP Standard)"))+
	geom_point(aes(y=NAEP,colour="Proficient Students (NAEP Standard)"))+
geom_line(aes(y = Proficient, colour = "Proficient Students (Ohio Standard)"),linetype="dashed")+
	geom_point(aes(y=Proficient,colour="Proficient Students (Ohio Standard)"))+
geom_line(aes(y = Required, colour = "AYP Proficiency Target"),linetype="dotted")+
	geom_point(aes(y=Required,colour="AYP Proficiency Target"))+
geom_line(aes(y = Failure, colour = "Districts Failing AYP"),linetype="longdash")+
	geom_point(aes(y=Failure,colour="Districts Failing AYP"))+
	 scale_color_manual(values=c("Proficient Students (Ohio Standard)"="blue", "AYP Proficiency Target"="darkgreen","Districts Failing AYP"="purple", "Proficient Students (NAEP Standard)"="red"),breaks=c("Proficient Students (Ohio Standard)","AYP Proficiency Target","Districts Failing AYP","Proficient Students (NAEP Standard)"))+
	 theme(legend.position="bottom",legend.direction ="vertical")+
	guides(colour=guide_legend(ncol=2))
dev.off()
